package model

type Role struct {
	RoleID    int64  `gorm:"column:role_id;primaryKey;autoIncrement;" json:"roleId"`
	RoleName  string `gorm:"column:role_name;" json:"roleName"`
	RoleKey   string `gorm:"column:role_key;" json:"roleKey"`
	RoleSort  int    `gorm:"column:role_sort;" json:"roleSort"`
	DataScope byte   `gorm:"column:data_scope;" json:"dataScope"`
	DelFlag   byte   `gorm:"column:del_flag;default:0" json:"delFlag"`
	Menus     []Menu `gorm:"many2many:sys_role_menu;joinForeignKey:role_id;joinReferences:menu_id" json:"menus"`
	Common    `gorm:"embedded"`
}

func (Role) TableName() string {
	return "sys_role"
}
